/*
 * @Description: 
 * @Date: 2020-12-15 17:26:58
 * @LastEditors: lother
 * @LastEditTime: 2021-01-07 16:48:10
 * @FilePath: \AccountOpening-H5\src\components\index.js
 */

const requireComponent = require.context('./page', true, /\.vue$/)
const install = (Vue) => {
  // 如果组件被注册就返回,没有就注册
  if (install.installed) return
  install.installed = true
  requireComponent.keys().forEach(filename => {
    // filename 文件
    // 第i个组件
    const config = requireComponent(filename)
    // 组件名
    const componentName = config.default.name
    // console.log(componentName, '================= 组件名') // 输出依次是Test LineChart PieChart
    // 循环注册组件
    Vue.component(componentName, config.default || config)
  })
}
export default {
  install
}